package com.baihan.angus.app.game.busshow.adps;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.baihan.angus.app.game.basic.base.BaseAdp;
import com.baihan.angus.app.game.busshow.R;

public class QuestionAnswerAdp extends BaseAdp<String, QuestionAnswerAdp.ViewHolder> {

    @Override
    protected RecyclerView.ViewHolder createYourViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_question_answer, parent, false);
        return new ViewHolder(view);
    }

    @Override
    protected void bindYourViewHolder(@NonNull ViewHolder holder, int position) {
        ViewHolder vh = holder;

        String data = getItem(position);

//        vh.tvQuestion.setText(data.getTitle());
//        StringBuilder sb = new StringBuilder();
//        for(int i = 0; i < data.getOptions().size(); i++) {
//            if (data.getOptions().get(i).isSelected()) {
//                sb.append(data.getOptions().get(i).getOp_value());
//                sb.append("  ");
//            }
//        }
//        vh.tvMyAnswer.setText(sb.toString());
    }

    @Override
    protected int getEmptyView() {
        return 0;
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {

        TextView tvQuestion, tvMyAnswer;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            tvQuestion = itemView.findViewById(R.id.tvQuestion);
            tvMyAnswer = itemView.findViewById(R.id.tvMyAnswer);
        }
    }
}
